using System;
using Framework.Library.Base.Base;

namespace Framework.Portal.Layouts.Admin.Components.Database
{
    public partial class StoreNew : BaseControl
    {
        //_StoredProcedure objProc = new _StoredProcedure();
        protected void Page_Load(object sender, EventArgs e)
        {
            //if ((!CurrentUser.IsSuperAdmin && CommandController.IsSystemModule(AdminPage.CurrentCommand.CommandID)) || !CommandController.IsAvailableForUser(AdminPage.CurrentCommand.CommandID, CurrentUser.UserID, Convert.ToInt32(cfg.Portal)))
            //    Response.Redirect(cfg.ADMIN_CMD, true);
            //if (!IsPostBack)
            //{
            //    lblCommandName.Text = MENUNAME;
            //    dropOwner.DataSource = Info.GetOwners();
            //    dropOwner.DataValueField = "name";
            //    dropOwner.DataTextField = "name";
            //    dropOwner.DataBind();

            //    Info.CheckDropList(dropOwner, "dbo");
            //}
        }

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            //try
            //{
            //    objProc.Create(txtDefinition.Text);
            //    Response.Redirect(MiscUtility.AdminUrlParams(CommandController.GetCommandbyID((int)PortalControls.Store)));
            //}
            //catch (Exception ex)
            //{
            //    lblError.Visible = true;
            //    lblError.Text = "<p>" + ex.Message + "</p>";
            //}
        }

        protected void btnNext_Click(object sender, EventArgs e)
        {
            //string strDefinition = "";

            //strDefinition += "CREATE PROCEDURE [" + dropOwner.SelectedValue + "].[" + txtName.Text + "]";
            //if (txtNumber.Text != "")
            //{
            //    strDefinition += ";" + txtNumber.Text;
            //}

            //switch (radioOptions.SelectedValue)
            //{
            //    case "":
            //        if (chkEncription.Checked)
            //        {
            //            strDefinition += "\nWITH ENCRYPTION\n";
            //        }
            //        break;
            //    case "RECOMPILE":
            //        if (chkEncription.Checked)
            //        {
            //            strDefinition += "\nWITH RECOMPILE, ENCRYPTION\n";
            //        }
            //        else
            //        {
            //            strDefinition += "\nWITH RECOMPILE\n";
            //        }
            //        break;
            //    case "FOR REPLICATION":
            //        if (chkEncription.Checked)
            //        {
            //            strDefinition += "\nWITH ENCRYPTION\nFOR REPLICATION";
            //        }
            //        else
            //        {
            //            strDefinition += "\nFOR REPLICATION";
            //        }
            //        break;
            //}

            //strDefinition += "\nAS\n\tBEGIN\n\t\t\n\tEND";
            //txtDefinition.Text = strDefinition;


            //pnlProcCode.Visible = true;
            //pnlOpt.Visible = false;
        }

        protected void btnBack_Click(object sender, EventArgs e)
        {
            //pnlOpt.Visible = true;
            //pnlProcCode.Visible = false;
        }
    }
}